package cn.fz.eventdemo01.listener;

import cn.fz.eventdemo01.event.LoginEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
public class LoginEventMessageNoticeListener implements LoginEventListener {

    @EventListener
    @Override
    @Order(11)
    public void handleUserLoginEvent(LoginEvent loginEvent) {
        // 发送消息通知用户
        System.out.println("message send User logged in: " + loginEvent.getUserName());
    }
}
